#!/usr/bin/env/python
# -*- coding: utf-8 -*-

# Django settings for django_logistics project.

DEBUG=False
TEMPLATE_DEBUG = DEBUG

ADMINS = (
    ('Svetlana Chukhareva', 'chukhareva.svetlana@gmail.com'),
)

MANAGERS = ADMINS

DATABASE_ENGINE = 'postgresql_psycopg2'           # 'postgresql_psycopg2', 'postgresql', 'mysql', 'sqlite3' or 'oracle'.
DATABASE_NAME = 'fishtrip'             # Or path to database file if using sqlite3.
DATABASE_USER = 'sveta'             # Not used with sqlite3.
DATABASE_PASSWORD = '5qwe'         # Not used with sqlite3.
DATABASE_HOST = ''             # Set to empty string for LOCALHOST. Not used with sqlite3.
DATABASE_PORT = ''             # Set to empty string for default. Not used with sqlite3.

# Local time zone for this installation. Choices can be found here:
# http://en.wikipedia.org/wiki/List_of_tz_zones_by_name
# although not all choices may be available on all operating systems.
# If running in a Windows environment this must be set to the same as your
# system time zone.
TIME_ZONE = 'Europe/Helsinki'

# Language code for this installation. All choices can be found here:
# http://www.i18nguy.com/unicode/language-identifiers.html
LANGUAGE_CODE = 'en-us'

LANGUAGES = (
    ('en', (u'English')),
    ('fi', (u'Suomi')),
    ('ru', (u'Русский')),
#    ('sv', (u'Svenska')),
)

SITE_ID = 1

# If you set this to False, Django will make some optimizations so as not
# to load the internationalization machinery.
USE_I18N = True

# Absolute path to the directory that holds the project
# This variable is added by sveta
#PROJECT_ROOT = '/home/sveta/DjangoProject'
PROJECT_ROOT = '__PROJECTROOT__'

# Absolute path to the directory that holds media.
# Example: "/home/media/media.lawrence.com/"
MEDIA_ROOT = ''

# URL that handles the media served from MEDIA_ROOT. Make sure to use a
# trailing slash if there is a path component (optional in other cases).
# Examples: "http://media.lawrence.com", "http://example.com/media/"
MEDIA_URL = ''

# URL prefix for admin media -- CSS, JavaScript and images. Make sure to use a
# trailing slash.
# Examples: "http://foo.com/media/", "/media/".
ADMIN_MEDIA_PREFIX = '/media/'

STATIC_DOC_ROOT = PROJECT_ROOT + '/django_logistics/staticfiles'

# Make this unique, and don't share it with anybody.
SECRET_KEY = '4o)trz$bl($9c=x-qpws7pe4(=dw+62@wf_x1)%6qrot4_9e^l'

#Settings to activate user
#Controls how many days emailed activation keys are valid. 
ACCOUNT_ACTIVATION_DAYS = 2
#Should be set to whatever host name your mail server is on.
EMAIL_HOST = 'localhost'
#Show a proper sender email address for your activation emails.
DEFAULT_FROM_EMAIL = 'webmaster@localhost'

#controls where a user is redirected after successful login by the contrib.auth.login view
LOGIN_REDIRECT_URL = '/'

# List of callables that know how to import templates from various sources.
TEMPLATE_LOADERS = (
    'django.template.loaders.filesystem.load_template_source',
    'django.template.loaders.app_directories.load_template_source',
#     'django.template.loaders.eggs.load_template_source',
)

# MIDDLEWARE_CLASSES order is important!
MIDDLEWARE_CLASSES = (
    'django.contrib.sessions.middleware.SessionMiddleware',
    'django.middleware.locale.LocaleMiddleware',
    'django_logistics.middleware.multiling.MultilingualURLMiddleware',
    'django.middleware.common.CommonMiddleware',
    'django.contrib.csrf.middleware.CsrfMiddleware',
    'django.contrib.auth.middleware.AuthenticationMiddleware',
#    'django.contrib.messages.middleware.MessageMiddleware', for Django v.1.2
)

ROOT_URLCONF = 'django_logistics.urls'

TEMPLATE_DIRS = (
    # Put strings here, like "/home/html/django_templates" or "C:/www/django/templates".
    # Always use forward slashes, even on Windows.
    # Don't forget to use absolute paths, not relative paths.
    #"C:/DjangoProject/fishman/templates"
    PROJECT_ROOT + '/django_logistics/templates'
)

#automatically populates the context with a few variables, according to TEMPLATE_CONTEXT_PROCESSORS 
    #TEMPLATE_CONTEXT_PROCESSORS setting is a tuple of callables -- called context processors -- 
    #that take a request object as their argument and return a dictionary of items to be merged 
    #into the context. By default, TEMPLATE_CONTEXT_PROCESSORS is set to:

TEMPLATE_CONTEXT_PROCESSORS = (
    "django.core.context_processors.auth",
#    "django.core.context_processors.debug",
    "django.core.context_processors.i18n",
#    "django.contrib.messages.context_processors.messages", #Django v.1.2
#    #"django.core.context_processors.media"      #return {'MEDIA_URL': settings.MEDIA_URL}
)

INSTALLED_APPS = (
    'django.contrib.auth',
    'django.contrib.contenttypes',
    'django.contrib.sessions',
    'django.contrib.sites',
    'django_logistics',
    'django.contrib.admin',
    'django_logistics.startpage',
    'django.contrib.admindocs',
    'django_logistics.registration',
    'django_logistics.orders',
    #'django.contrib.messages', #Django v.1.2
    #'django_logistics.testdrive',
    #'django_logistics.viewtools',
)

